package be.shoktan.tutorial.chapterThree;

import java.io.File;

import be.shoktan.tutorial.BaseAction;
import be.shoktan.tutorial.services.PortfolioService;

public class ImageUpload extends BaseAction{
	private static final long serialVersionUID = 292776645257680638L;
	private File pic;
	private String picConcentType;
	private String picFileName;
	public File getPic() {
		return pic;
	}
	public void setPic(File pic) {
		this.pic = pic;
	}
	public String getPicConcentType() {
		return picConcentType;
	}
	public void setPicConcentType(String picConcentType) {
		this.picConcentType = picConcentType;
	}
	public String getPicFileName() {
		return picFileName;
	}
	public void setPicFileName(String picFileName) {
		this.picFileName = picFileName;
	}
	
	public String execute(){
		getPortfolioService().addImage(getPic());
		return SUCCESS;
	}
	private PortfolioService getPortfolioService() {
		return PortfolioService.getInstance();
	}
}
